/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * HaveAdvanceRefundMapper.java
 */
package com.emm.yixun.basic.mapper;

import com.emm.yixun.common.model.HaveAdvanceRefund;
import com.emm.yixun.common.model.HaveAdvanceRefundInfo;
import com.emm.yixun.common.model.dto.HaveAdvanceRefundDto;
import com.emm.yixun.common.model.dto.HaveAdvanceRefundInfoDto;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * [文件名称]<br>
 * HaveAdvanceRefundMapper.java<br>
 * <br>
 * [文件描述]<br>
 * 已收/退款表 mapper<br>
 * <br>
 * [修改记录]<br>
 * 2016-07-04 14:18:20 创建<br>
 * @version 1.00
 */
public interface HaveAdvanceRefundMapper {
    
	/**
	 * 新增
	 * @param haveAdvanceRefund 新增BEAN信息
	 * @return 操作行数
	 */
	public int add(HaveAdvanceRefund haveAdvanceRefund);
	/**
	 * 删除
	 * @param haveAdvanceRefundDto 满足删除的条件
	 * @return 操作行数
	 */
    public int del(HaveAdvanceRefundDto haveAdvanceRefundDto);
	/**
	 * 删除
	 * @param ids 待删除的唯一主键拼接的字符串,主键间以,隔开
	 * @return 操作行数
	 */
    public int dels(String ids);
    /**
     * 编辑
     * @param haveAdvanceRefund 需要编辑的BEAN信息
     */
    public int edit(HaveAdvanceRefund haveAdvanceRefund);
    /**
     * 编辑
     * @param haveAdvanceRefund 需要编辑的BEAN信息
     * @param ids 待编辑的唯一主键拼接的字符串,主键间以,隔开
     * @return 更新行数
     */
    public int edits(@Param("haveAdvanceRefundDto") HaveAdvanceRefund haveAdvanceRefund, @Param("ids") String ids);
    /**
     * 搜索总数
     * @param haveAdvanceRefundDto 搜索条件
     * @return 符合条件记录总数
     */
	public int count(HaveAdvanceRefundDto haveAdvanceRefundDto);
    /**
	 * 搜索 - 支持分页
	 * @param haveAdvanceRefundDto (搜索条件)
	 * @param beginNum 分页开始页不包含
	 * @param endNum 分页结束页不包含
	 * @return 分页数据
	 */
	public List<HaveAdvanceRefund> list(@Param("haveAdvanceRefundDto") HaveAdvanceRefundDto haveAdvanceRefundDto, @Param("beginNum") int beginNum, @Param("endNum") int endNum);
   
	/**
     * 搜索总数
     * @param haveAdvanceRefundDto 搜索条件
     * @return 符合条件记录总数
     */
	public int countInfo(HaveAdvanceRefundInfoDto haveAdvanceRefundDto);
    /**
	 * 搜索 - 支持分页
	 * @param haveAdvanceRefundDto (搜索条件)
	 * @param beginNum 分页开始页不包含
	 * @param endNum 分页结束页不包含
	 * @return 分页数据
	 */
	public List<HaveAdvanceRefundInfo> listInfo(@Param("haveAdvanceRefundDto") HaveAdvanceRefundInfoDto haveAdvanceRefundDto, @Param("beginNum") int beginNum, @Param("endNum") int endNum);


	/**
	 * 搜索总数
	 * @param haveAdvanceRefundDto 搜索条件
	 * @return 符合条件记录总数
	 */
	public int countReport(HaveAdvanceRefundInfoDto haveAdvanceRefundDto);
	/**
	 * 搜索 - 支持分页
	 * @param beginNum 分页开始页不包含
	 * @param endNum 分页结束页不包含
	 * @return 分页数据
	 */
	public List<HaveAdvanceRefundInfo> listReport(@Param("haveAdvanceRefundDto") HaveAdvanceRefundInfoDto haveAdvanceRefundDto, @Param("beginNum") int beginNum, @Param("endNum") int endNum);

    /**
	 * 搜索 
	 * @param haveAdvanceRefundDto (搜索条件)
	 * @return 分页数据
	 */
	public List<HaveAdvanceRefund> selectListByDto(@Param("haveAdvanceRefundDto") HaveAdvanceRefundDto haveAdvanceRefundDto);
	
    /**
	 * 搜索 - 支持分页
	 * @param haveAdvanceRefundDto (搜索条件)
	 * @return 分页数据
	 */
	public HaveAdvanceRefund selectByDto(@Param("haveAdvanceRefundDto") HaveAdvanceRefundDto haveAdvanceRefundDto);
	
	/**
	 * @param id
	 * @return
	 * 根据id查询记录
	 */
	public HaveAdvanceRefund selectById(@Param("id") Long id);
	
	/**
	 * @param id
	 * @return
	 * 根据id查询记录
	 */
	public HaveAdvanceRefundInfo selectInfoById(@Param("id") Long id);
	
	/**
	 * 已收款金额
	 * 
	 * @param haveAdvanceRefundDto
	 * @return
	 */
	public Double haveAdvanceAmount(HaveAdvanceRefundDto haveAdvanceRefundDto);
	
	
	public BigDecimal findSubscribeHaveAmount(@Param("subId") Long subId);


	public int findHaveAdvanceInfoCount(@Param("haveAdvanceRefundInfo") HaveAdvanceRefundInfo haveAdvanceRefundInfo);

	/**
	 * 查询回款记录
	 */
	public List<HaveAdvanceRefundInfo> findHaveAdvancePageInfoByDto(@Param("haveAdvanceRefundInfo") HaveAdvanceRefundInfo haveAdvanceRefundInfo, @Param("beginNum") int beginNum, @Param("endNum") int endNum);

	/**
	 * 查询回款记录(导出)
	 */
	public List<HaveAdvanceRefundInfo> findHaveAdvanceInfoByDto(@Param("haveAdvanceRefundInfo") HaveAdvanceRefundInfo haveAdvanceRefundInfo);



}
